Manages the complex effects available in the component. More...
Public Member Functions | |
| ComplexEffect * | createOrRetrieve (const nkMemory::StringView &name, COMPLEX_EFFECT_TYPE type) |
| ComplexEffect * | get (const nkMemory::StringView &name) |
| ComplexEffect * | getByIndex (unsigned int id) |
| void | rename (const nkMemory::StringView ¤tName, const nkMemory::StringView &newName) |
| void | erase (const nkMemory::StringView &name) |
Manages the complex effects available in the component.
At all times, manager owns any memory allocated inside. External code should never delete memory returned by it.
| ComplexEffect* nkAstraeus::ComplexEffectManager::createOrRetrieve | ( | const nkMemory::StringView & | name, |
| COMPLEX_EFFECT_TYPE | type | ||
| ) |
Creates if unavailable, or retrieves if available, a complex effect.
Depending on the parameter given for the type, the ComplexEffect instance retrieved will be :
| Value | Pointer type |
|---|---|
| EFFECT_TYPE::BLUR | BlurComplexEffect |
| EFFECT_TYPE::DOF | DofComplexEffect |
To address it fully, casting is required. For instance :
| name | The name of the complex effect to retrieve. |
| type | The complex effect type to create. |
| ComplexEffect* nkAstraeus::ComplexEffectManager::get | ( | const nkMemory::StringView & | name | ) |
Retrieves a complex effect.
| name | The name of the complex effect to retrieve. |
| ComplexEffect* nkAstraeus::ComplexEffectManager::getByIndex | ( | unsigned int | id | ) |
Get a complex effect, by index. Note that one index can map to a different effect after memory is changed. Useful to loop over all available effects in one go.
| id | The index of the complex effect to retrieve. |
| void nkAstraeus::ComplexEffectManager::rename | ( | const nkMemory::StringView & | currentName, |
| const nkMemory::StringView & | newName | ||
| ) |
Renames a complex effect.
| currentName | The name of the complex effect to rename. |
| newName | The name to reassign to the complex effect. |
| void nkAstraeus::ComplexEffectManager::erase | ( | const nkMemory::StringView & | name | ) |
Erases and frees a complex effect.
| name | The name of the complex effect to erase. |